/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 07 - 06
 * Time: 11:22
 */
//判断是否为丑数(只有质因数2,3,5)
class Solution1 {
    public static boolean isUgly(int n) {
        if(n <= 0) {
            return false;
        }
        int[] arr = new int[]{2, 3, 5};
        for(int x : arr) {
            while(n % x == 0) {
                n /= x;
            }
            if(n == 1) {
                return true;
            }
        }
        return false;
    }
}